Python Draw Text on Image Posted on 2022-06-16 | In programming language , Python Use PIL12345678import PIL.ImageDrawimport PIL.Imageimport PIL.ImageFontpil_img = PIL.Image.fromarray(bb_img)draw = PIL.ImageDraw.Draw(pil_img)font = PIL.ImageFont.truetype("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf",20)draw.text((10, 10),"Frame: %09d"%(iframe),(255,0,0),font=font) Use OpenCV— 12import cv2cv2.putText(cv_img, 'Frame: %d'%(iframe), (10,20), cv2.FONT_HERSHEY_SIMPLEX, 0.65, (0,0,255), 3)